package com.hhkj.api.commission.controller;

import com.hhkj.api.commission.model.req.ApiCommissionPagingReq;
import com.hhkj.api.commission.service.biz.ApiSaleCommissionBizService;
import com.hhkj.api.sale.common.session.model.LoginSale;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.framework.login.api.ApiLogin;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * ApiSaleCommissionController
 *
 * @author zheng
 * @since 2023/11/7 0:25
 */
@RequestMapping("/api/sale/commission")
@RestController
public class ApiSaleCommissionController extends BaseController {

    @Autowired
    private ApiSaleCommissionBizService commissionBizService;

    /** 明细分页 */
    @ApiLogin(LoginSale.class)
    @PostMapping("/paging")
    public TableDataInfo paging(@RequestBody ApiCommissionPagingReq req) {
        startPageBody(req);
        return getDataTable(commissionBizService.paging(req));
    }

    /** 佣金信息 */
    @ApiLogin(LoginSale.class)
    @GetMapping("/count")
    public AjaxResult count() {
        return AjaxResult.success(commissionBizService.count());
    }
}
